<div class="author">
    <h1 class="author__heading">Hi, I am Raddy.</h1>
    <p class="author__body">Web developer and content creator.</p>
</div>

<img src="/img/hero-image.webp" alt="person looking out through window" class="hero-image" width="981" height="528">

<section class="articles">
    <h2 class="articles__heading">Latest Posts</h2>

    <ul class="article-ul">
        <% data.forEach(post => { %>
            <li>
              <a href="/post/<%= post._id %>">
                <span><%= post.title %></span>
                <span class="article-list__date">
                    <%= post.createdAt.toDateString() %>
                </span>
              </a>
            </li>
        <% }) %>
    </ul>
    
    <!-- 
    <ul class="article-ul">
        <li>
            <a href="#">
                <span>Post Title</span>
                <span class="article-list__date">Data</span>
            </a>
        </li>
    </ul> -->
    <% if (nextPage !== null) { %>
    <a href="/?page=<%= nextPage %>" class="pagination">&lt; View Older Posts</a>
    <% } %>
</section>